#include <iostream>
#include <clocale>
#include <vector>
#include <thread>
#include "Player.h"
#include "Game.h"
#include "Console.h"

#define MAP 10
using namespace std;
using namespace Course;

int main()
{
	setlocale(LC_ALL, "swedish");

	deque<char> player_queue1;
	deque<char> player_queue2;
	deque<Pos> game_queue;
	//        Controls                 Spawn positions  map-size
	Player p1('w', 'a', 's', 'd', '1', MAP-MAP, MAP-MAP, MAP, player_queue1, game_queue);
	Player p2('i', 'j', 'k', 'l', '2', MAP-1, MAP-1, MAP, player_queue2, game_queue);
	Game game(MAP, player_queue1, player_queue2, game_queue);

	thread t_game(game);
	thread t_p1(p1);
	thread t_p2(p2);

	t_game.join();
	t_p1.join();
	t_p2.join();

	cout << endl;
	system("PAUSE");
	return 0;
}